package com.edu.exam.enums.examination;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 监控类型枚举
 */
@Getter
@AllArgsConstructor
public enum MonitoringType {
    REAL_TIME("REAL_TIME", "实时监控"),
    PERIODIC("PERIODIC", "周期监控"),
    EVENT_DRIVEN("EVENT_DRIVEN", "事件驱动"),
    CONTINUOUS("CONTINUOUS", "连续监控"),
    MANUAL("MANUAL", "手动监控"),
    AUTOMATED("AUTOMATED", "自动监控"),
    PROACTIVE("PROACTIVE", "主动监控"),
    REACTIVE("REACTIVE", "被动监控"),
    INTELLIGENT("INTELLIGENT", "智能监控"),
    HYBRID("HYBRID", "混合监控");

    private final String code;
    private final String description;

    public static MonitoringType fromCode(String code) {
        for (MonitoringType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return REAL_TIME; // 默认返回实时监控
    }
}